home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1996 June
/
Software of the Month Club 1996 June.iso
/
pc
/
dos
/
dtp
/
display
/
util
/
finddrv.c
next >
Wrap
C/C++ Source or Header
|
1996-01-06
|
460b
|
26 lines
/*
Find all system disk drives
Written by Jih-Shin Ho, 1995
*/
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
int main()
{
union REGS regs;
int i;
printf("Disk drive found : ");
for (i = 0; i < 26; ++i) {
regs.x.ax = 0x4409; /* get drive flags */
regs.h.bl = i + 1; /* 1-based dos drive */
intdos(®s,®s);
if (!regs.x.cflag) printf("%c ",'A' + i);
}
printf("\n");
return(0);
}